USE [CMS]
GO

/****** Object:  Table [dbo].[Upload]    Script Date: 12/31/2012 11:52:06 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[Upload](
	[ADM_ID] [bigint] NOT NULL,
	[UPL_ID] [bigint] IDENTITY(1,1) NOT NULL,
	[USR_ID] [bigint] NOT NULL,
	[UPL_NAME] [varchar](150) NOT NULL,
	[UPL_GUID] [varchar](200) NOT NULL,
	[UPL_COMMENTS] [varchar](max) NULL,
	[MUT_DELETED] [datetime] NULL,
 CONSTRAINT [PK_Upload] PRIMARY KEY CLUSTERED 
(
	[UPL_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[Upload]  WITH CHECK ADD  CONSTRAINT [FK_Upload_Administration] FOREIGN KEY([ADM_ID])
REFERENCES [dbo].[Administration] ([ADM_ID])
GO

ALTER TABLE [dbo].[Upload] CHECK CONSTRAINT [FK_Upload_Administration]
GO

ALTER TABLE [dbo].[Upload]  WITH CHECK ADD  CONSTRAINT [FK_Upload_Users] FOREIGN KEY([USR_ID])
REFERENCES [dbo].[Users] ([USR_ID])
GO

ALTER TABLE [dbo].[Upload] CHECK CONSTRAINT [FK_Upload_Users]
GO


